/********************************
 *版权所有 CopyRight(c) 快程乐码信息有限公司所有，未经授权，不得复制、转发
 */
package com.yjx.test.dozer.converterClazz;

import org.dozer.DozerConverter;

import java.time.LocalDate;

/************
 *@Author yejx
 *@version v1.0
 *@create 2020/7/1 11:00
 *@Description TODO
 *
 */
public class LocalDateToLocalDateConverter extends DozerConverter<LocalDate, LocalDate> {

    public LocalDateToLocalDateConverter() {
        super(LocalDate.class, LocalDate.class);
    }

    @Override
    public LocalDate convertTo(LocalDate localDate, LocalDate localDate2) {
        System.out.println("localDate = " + localDate);
        LocalDate newDate = localDate2.parse(localDate.toString());
        System.out.println("newDate = " + newDate);
        return newDate;
    }

    @Override
    public LocalDate convertFrom(LocalDate localDate, LocalDate localDate2) {
        System.out.println("-- convertFrom...");
        LocalDate newDate = localDate2.parse(localDate.toString());
        System.out.println("newDate = " + newDate);
        return newDate;
    }
}
